package kit.edu.lego.gruppe3.levels.rotateBridge;

import kit.edu.lego.gruppe3.ComponentsRepository;
import kit.edu.lego.gruppe3.levels.LevelSelector;
import kit.edu.lego.gruppe3.sensors.Scanner;
import lejos.nxt.LightSensor;
import lejos.robotics.navigation.DifferentialPilot;
import lejos.robotics.subsumption.Behavior;

public class MoveOnDisc implements Behavior{
	
	private DifferentialPilot robot = ComponentsRepository.getInstance().getRobotPilot();
	LightSensor lightSensor = ComponentsRepository.getInstance().getLightSensor();

	@Override
	public void action() {
		robot.setTravelSpeed(15);
		
		robot.steer(-100);
//		robot.travelArc(85, 15.0f);
	}

	@Override
	public void suppress() {
	}

	@Override
	public boolean takeControl() {
		return LevelSelector.getInstance().isRotatingBridge() &&
				lightSensor.readValue() > 60;
	}

}
